﻿@{
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

<div>
    <table>
        <tr>
            <td>用户名：</td>
            <td>
                <input type="text" name="u_UserName" value="" /></td>
        </tr>
        <tr>
            <td>密码：</td>
            <td>
                <input type="password" name="u_Password" value="" /></td>
        </tr>
        <tr>
            <td>真实姓名：</td>
            <td>
                <input type="text" name="u_RealName" value="" /></td>
        </tr>
        <tr>
            <td>手机号码：</td>
            <td>
                <input type="text" name="u_MobliePhone" value="" /></td>
        </tr>
        <tr>
            <td>性别：</td>
            <td>男：<input type="radio" name="u_Gender" value="男" checked="checked" />
                女：<input type="radio" name="u_Gender" value="女" />
            </td>
        </tr>
        <tr>
            <td>邮箱：</td>
            <td>
                <input type="text" name="u_Email" value="" /></td>
        </tr>
        <tr>
            <td>备注：</td>
            <td>
                <textarea rows="4" cols="30" name="u_Remark"></textarea></td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="button" value="提交" onclick="AddUser()" /></td>
        </tr>
    </table>
    <script type="text/javascript">
        function AddUser() {
            $.ajax({
                type: "POST",
                url: "/User/AEUser",
                data: {
                    u_UserName: $("[name=u_UserName]").val(),
                    u_Password: $("[name=u_Password]").val(),
                    u_RealName: $("[name=u_RealName]").val(),
                    u_MobliePhone: $("[name=u_MobliePhone]").val(),
                    u_Gender: $("[name=u_Gender]:checked").val(),
                    u_Email: $("[name=u_Email]").val(),
                    u_Remark: $("[name=u_Remark]").val()
                },
                success: function (msg) {
                    if (msg == "success") {
                        S_success();
                    } else if (msg == "error") {
                        E_error();
                    } else {
                        E_errorMsg(msg);
                    }
                }
            });
        }
    </script>
</div>
